﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EventLogAssembly
{
    public delegate void TreeRefreshEventHandler(object sender, TreeEventArgs e);
    public class TreeEventHandler
    {
        List<TreeRefreshEventHandler> _handlers;

        public TreeEventHandler()
        {
            _handlers = new List<TreeRefreshEventHandler>();
        }

        public void Invoke(object sender, TreeEventArgs e)
        {
            foreach (TreeRefreshEventHandler handler in this._handlers)
            {
                handler(sender, e);
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="priority">From 0 to 127</param>
        public void AddHandler(TreeRefreshEventHandler handler)
        {
            _handlers.Add(handler);
        }
    }
}
